import java.awt.Component;
import javax.swing.JProgressBar;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

class ProgressRenderer extends JProgressBar implements TableCellRenderer {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public ProgressRenderer() {
		super(JProgressBar.HORIZONTAL);
		setBorderPainted(false);
		setStringPainted(true);
	}

	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int col) {
		if (value instanceof Integer) {
			setBackground(table.getBackground());
            
			int i = ((Integer) value).intValue();
			setValue(i);
			
		}

		return this;
	}
}